package chapter05

/**
 * Created with IntelliJ IDEA.
 * ClassName: Test10_Recursion
 * Package: chapter05
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 *          Date: 2023-06-20
 *          Time: 17:10
 */

//递归
object Test10_Recursion {
  def main(args: Array[String]): Unit = {
    println(fact(5))
  }

  def fact(i: Int): Int = {
    if (i == 0) return 1
    fact(i - 1) * i
  }

}
